package org.hhchat.leetcode.string;

/**
 * Created this one by HMH on 2017/5/30.
 */
public class code551 {
    public static class Solution {
        public boolean checkRecord(String s) {
            int countA;
            countA = 0;
            if(s.contains("LLL")) return false;
            for (char c : s.toCharArray()) {
                if(c=='A'){
                    countA++;
                    if(countA==2) return false;
                }
            }
            return true;
        }
    }

    public static void main(String[] args){
        String s = "PPALLL";
        Solution solution = new Solution();
        System.out.println(solution.checkRecord(s));
    }
}
